package com.whjh.image.conpression.task;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;



@ConditionalOnExpression("#{@environment.getProperty('image.conpression.enableForkJoin') == 'true' && @environment.getProperty('image.conpression.enableType') == 'cron'}")
@Component
public class CronTaskForkJoin extends ImageCompressionTaskForkJoin {
	private static Logger logger = LoggerFactory.getLogger(CronTaskForkJoin.class);
	
	@Scheduled(cron = "${image.conpression.cron}")
	public void execute() throws InterruptedException, IOException {
		logger.info("CronTaskForkJoin");
		doExecute();
	}
}
